﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TXTD.Admin.Model.Paging
{
    /// <summary>
    /// 分页信息
    /// </summary>
    public class PageInfo
    {
        /// <summary>
        /// 每页多少条数据
        /// </summary>
        public int PageSize { get; set; }
        /// <summary>
        /// 第几页
        /// </summary>
        public int PageIndex { get; set; }
        /// <summary>
        /// 总条数
        /// </summary>
        public int TotalCount { get; set; }
        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPageCount
        {
            get
            {
                return TotalCount / PageSize + 1;
            }
        }
        /// <summary>
        /// 跳过
        /// </summary>
        public int SkipCount
        {
            get
            {
                return PageSize * (PageIndex - 1);
            }
        }
        /// <summary>
        /// 取值
        /// </summary>
        public int TakeCount
        {
            get
            {
                return PageSize;
            }
        }
    }
}
